﻿using DrawTools;
using LS.DicomViewer.Common;
using System;
using System.Windows;

namespace LS.Dicom.Tools
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            this.DispatcherUnhandledException += App_DispatcherUnhandledException;
            WpfImageManager.Init();
            try
            {
                var _ = DrawerConfig.Instance.DefaultBrush;
            }
            catch { }
        }


        private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            e.Handled = true;
            e.Dispatcher.BeginInvoke(new Action(() =>
            {
                var message = e.Exception.GetBaseException().Message;
                MessageBox.Show(message, "系统提示");
            }));
        }
    }
}
